<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="keywords" content="admin, dashboard, bootstrap, template, flat, modern, theme, responsive, fluid, retina, backend, html5, css, css3">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">

  <title>修改密码</title>
  
  <!--common-->
  <link href="/static/css/public/style.css" rel="stylesheet">
  <link href="/static/css/public/style-responsive.css" rel="stylesheet">

  <!--dynamic table-->
  <link href="/static/js/public/advanced-datatable/css/demo_page.css" rel="stylesheet" />
  <link href="/static/js/public/advanced-datatable/css/demo_table.css" rel="stylesheet" />
  <link rel="stylesheet" href="/static/js/public/data-tables/DT_bootstrap.css" />


  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->
</head>

<body class="sticky-header">
	<!-- 左侧菜单开始-->
	{include file="public/nav_left"}
    <!-- 左侧菜单结束-->
    
    <!-- main content start-->
    <div class="main-content" >

        <!-- 头部菜单开始-->
          {include file="public/nav_top"}
        <!-- 头部菜单结束-->
        
        
        <!-- page heading start-->
        <div class="page-heading">
            <h3>
               用户管理
            </h3>
        </div>
        <!-- page heading end-->

        <!--主内容开始-->
        <div class="wrapper">
            <div class="row">
        <div class="col-sm-12">
        <section class="panel">
        <header class="panel-heading">
            设置密码信息
            <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <!--<a href="javascript:;" class="fa fa-times"></a>-->
             </span>
        </header>
        <input id="changePwd"  value="" type="hidden">
        <div class="panel-body">
        <div class="adv-table">
        <div class="panel-body">
            <div class="form-horizontal adminex-form">
                <div class="form-group">
                    <label class="col-sm-2 control-label col-lg-2">请输入当前密码</label>
                    <div class="col-lg-10">
                        <input class="form-control" id="oldpassword" name="oldpassword" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label col-lg-2">请输入修后改密码:</label>
                    <div class="col-lg-10">
                        <input type="password" class="form-control" id="password" name="password" value="">
                     </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label col-lg-2">确认修改后密码：</label>
                    <div class="col-lg-10">
                        <input type="password" class="form-control" id="repassword" name="repassword" value="">
                    </div>
                </div>
            </div>
            <div style="text-align: center;padding-top: 10px;">
                <button class="btn btn-primary" id="edit_btn">确定</button>&nbsp
                <button class="btn btn-primary" onclick="history.back()">返回</button>
            </div>
        </div>
        <!--main begin-->
        <!--main end-->
        </div>
        </div>
        </section>
        </div>
        </div>
        </div>
        <!--主内容结束-->
    </div>
    <!-- main content end-->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="/static/js/public/jquery-1.10.2.min.js"></script>
<script src="/static/js/public/jquery-ui-1.9.2.custom.min.js"></script>
<script src="/static/js/public/jquery-migrate-1.2.1.min.js"></script>
<script src="/static/js/public/bootstrap.min.js"></script>
<script src="/static/js/public/modernizr.min.js"></script>
<script src="/static/js/public/jquery.nicescroll.js"></script>
<script src="/static/js/public/layer.js"></script>
<!--dynamic table-->
<script src="/static/js/public/advanced-datatable/js/jquery.dataTables.js"></script>
<script src="/static/js/public/data-tables/DT_bootstrap.js"></script>
<!--dynamic table initialization -->
<script src="/static/js/public/dynamic_table_init.js"></script>
<!--common scripts for all pages-->
<script src="/static/js/public/scripts.js"></script>

<script>
    $(function(){
        $('#edit_btn').click(function(){
            var oldpassword = $('#oldpassword').val();
            var password1 = $('#password').val();
            var password2 = $('#repassword').val();
            if(!oldpassword){
                layer.msg("请输入旧密码");
                return false;
            }
            if(!password1){
                layer.msg("请输入新密码");
                return false;
            }
            if(password1 !== password2){
                layer.msg("两次输入密码不一致,请重试");
                return false;
            }
            $.post("/admin/User/editPasswordHandle",{'oldPassword': oldpassword, 'password': password1, 'repassword': password2},function(data){
                if(data.status === 1){
                    layer.alert(data.msg, {
                        skin: 'layui-layer-lan' //样式类名
                        ,closeBtn: 1
                    }, function(){
                        location.href="/admin/home/index";
                    });
                }else{
                    layer.msg(data.msg);
                }
            });
        });
    })
</script>
</body>
</html>
